# import logging,yagmail
# import time
# #定义时间
# t = time.strftime('%Y%m%d_%H_%M_%S')
# #日志
# def log_set():
#     logging.basicConfig(filename=f'log_{t}.txt',
#                         level=logging.DEBUG,
#                         filemode='a+',
#                         format='%(asctime)s -> %(filename)s -> %(message)s -> %(lineno)s')
#
# #邮件
# def send_mail(filepath):
#     mail = yagmail.SMTP(user='2930885223@qq.com',password='zlmqxmanqbtsdcgh',host='smtp.qq.com')
#     mail.send(to='2930885223@qq.com',subject='163邮箱测试报告',contents='今日报告，请查收！',attachments=filepath)

import logging,yagmail
import time
#时间戳
t = time.strftime('%Y%m%d_%H%M%S')
#日志
def log_set():
    logging.basicConfig(filename=f'log_{t}.txt',
                        level=logging.DEBUG,
                        filemode='a+',
                        format='%(asctime)s -> %(filename)s -> %(levelname)s -> %(funcName)s')
#邮件
def send_mail(filepath):
    mail = yagmail.SMTP(user='2930885223@qq.com',password='zlmqxmanqbtsdcgh',host='smtp.qq.com')
    mail.send(to='2930885223@qq.com',subject='测试报告',contents='今日报告，请查收！',attachments=filepath)




